<?php
include dirname(dirname(__FILE__)).'/admin-verify.php';
require dirname(__FILE__).'/functions.php';
include_once dirname(dirname(dirname(__FILE__))).'/include/host-base.php';

$deleteId = addslashes($_GET['id']);
$ret_row = getUserById($deleteId);
if($ret_row==null)alertInfo("该用户不存在",getHost().'/admin/index.php');
if($_SESSION['user_role']=="super_admin"||$_SESSION['user_role']=="admin"
	&&$ret_row['user_role']=="user") {
	if(deleteUser($deleteId)) {
		alertInfo("删除成功！",getHost().'/admin/user-manage/index.php');
	}
	else {
		alertInfo("删除失败！",getHost().'/admin/user-manage/index.php');
	}
} else {
	alertInfo("你没有权限执行该操作！",getHost().'/admin/index.php');
}